package com.xmy.cultivate.mapper;

import com.xmy.cultivate.entity.TryJob;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 试岗 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2025-05-07
 */
public interface TryJobMapper extends BaseMapper<TryJob> {


    @Select({"<script>",
            "SELECT t1.*",
            "FROM adms_try_job AS t1",
            "LEFT JOIN adms_recruit_push_log AS t2 ON t1.recruit_id = t2.recruit_id AND t2.type = 1",
            "WHERE 1=1",
            "  AND t1.is_arrive_job = 0",
            "  AND t1.pass_type = 0",
            "  AND t2.id IS NULL",
            "  AND t1.try_date &lt;= #{formattedDate}",
            "ORDER BY t1.school_id",
            "</script>"})
    List<TryJob> getTryJobPushList (@Param("formattedDate") String formattedDate);

}
